home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_02_04 / 2n04061a < prev    next >
Text File  |  1991-01-26  |  890b  |  41 lines

  1. { Demonstrates the use of function RdKey which is
  2.   assumed to be in a CrtExt.tpu which contains
  3.   your "extenders" for TP's Crt unit.
  4. }
  5. program DemoRdKey;
  6.  
  7. uses
  8.    crt, crtext;
  9.  
  10. var
  11.    QuickCh : char;
  12.    FullCh  : keyrec;
  13.  
  14. begin
  15.   clrscr;
  16.   repeat
  17.   write('Press a key: ');
  18.   QuickCh := RdKey(FullCh);
  19.   writeln;
  20.   writeln;
  21.   writeln('Quickch (ReadKey''s ch) is ''',
  22.           QuickCh,''' with ascii ',ord(QuickCh));
  23.   writeln;
  24.   if ord(QuickCh) <> 0 then
  25.     begin
  26.      writeln('FullCh.ch is ''', Fullch.ch,'''',
  27.           ' with ascii ',ord(FullCh.ch));
  28.      writeln('FullCh.sc is ', FullCh.sc,' (scan code)');
  29.     end
  30.   else
  31.     begin
  32.      writeln('FullCh.ch is ''', Fullch.ch,'''',
  33.           ' with moved scan ',ord(FullCh.ch));
  34.      writeln('FullCh.sc is ', FullCh.sc,' (sp k flag)');
  35.     end;
  36.   writeln;
  37.   writeln;
  38.   until QuickCh = 'q'
  39. end.
  40.  
  41.